Update module github.com/go-chi/chi/v5 to v5.2.4 [SECURITY]#47
Open
renovate[bot] wants to merge 1 commit into
Open
Update module github.com/go-chi/chi/v5 to v5.2.4 [SECURITY]#47renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR contains the following updates:
v5.2.2→v5.2.4chi has an open redirect vulnerability in the RedirectSlashes middleware
CVE-2025-69725 / GHSA-mqqf-5wvp-8fh8
More information
Details
Summary
The
RedirectSlashesfunction in middleware/strip.go does not perform correct input validation and can lead to an open redirect vulnerability.Details
The
RedirectSlashesfunction performs aTrimto all forward slash (/) characters, while prepending a single one at the begining of the path (Line 52).However, it does not trim backslashes (
\).Also, from version 5.2.2 onwards the
RedirectSlashesfunction does not take into consideration theHostHeader in the redirect response returned. This was done in order to combat another [vulnerability](https://redirect.github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93).The above make it possible for a response in the following form:
The
/\evil.comwill be transformed by most browsers (Chrome, Firefox, etc. not Safari) into//evil.comwhich is a protocol relative URL and will result in a redirect toevil.com, essentially making it an open redirect vulnerability.PoC
A minimal working example can be seen below.
And when we request the path
/\evil.com(needs a second backslash or URL encoding in the terminal), the HTTP Redirect Location is just/\evil.comwithout any domain/Host information.This opened in a browser (Chrome, Firefox) will result in a transformation to

//evil.comwhich in turn will result in a redirect toevil.com.Impact
This essentially consists of an open redirect vulnerability, provided that victim users use the most popular browsers (Chrome, Firefox, etc. It does not work in e.g. Safari).
The attacker can construct a malicious URL on a domain of a legitimate website and send it to the victim user. The victim users thinking that they will click on a legitimate website's URL, they will unknowingly be reidrected to an attacker controlled website.
This can lead to credential theft if the victim gets redirected to a phishing website, to malware that is hosted on the attacker controlled website etc. Also, it has a greate reputation / business impact for the affected legitimate website.
In order to exploit this vulnerability the attacker does not need to be authenticated or have ay other priviledge / knowledge regarding the affected application.
CVSS Score: 4.7 (Medium)
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
go-chi/chi (github.com/go-chi/chi/v5)
v5.2.4Compare Source
v5.2.3Compare Source
What's Changed
New Contributors
Full Changelog: go-chi/chi@v5.2.2...v5.2.3
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.